﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
    xmlns:dxt="http://schemas.devexpress.com/winfx/2008/xaml/core/themekeys"
    xmlns:local="clr-namespace:UColor.WPF">

    <Style TargetType="{x:Type local:ImageControl}">
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:ImageControl}">
                    <Grid HorizontalAlignment="Left" VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource TemplatedParent}}" SnapsToDevicePixels="True">
                        <Border Margin="4,4,0,0" Background="#5A5873A1" CornerRadius="4,4,4,4" Opacity="1" />
                        <Border Width="Auto" Height="Auto" CornerRadius="3,3,3,3" Padding="1,1,1,1" Margin="0,0,4,4">
                            <Border.Background>
                                <LinearGradientBrush EndPoint="0.5,-0.003" StartPoint="0.5,1.003">
                                    <GradientStop Color="#FF688DC5" Offset="1" />
                                    <GradientStop Color="#FF7493CE" Offset="0" />
                                </LinearGradientBrush>
                            </Border.Background>
                            <Border Width="Auto" Height="Auto" CornerRadius="2,2,2,2" Padding="4,4,4,4">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                                        <GradientStop Color="#FFE7F0FA" Offset="0" />
                                        <GradientStop Color="#FFFFFFFF" Offset="1" />
                                    </LinearGradientBrush>
                                </Border.Background>
                                <!--BEGIN WPF-->
                                <dx:TransferControl SpeedRatio="3" Style="{DynamicResource {dxt:TransferControlThemeKey ResourceKey=TransferControl_FadeStyle}}" Content="{Binding Path=Source, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ImageControl}}}">
                                    <dx:TransferControl.ContentTemplate>
                                        <DataTemplate>
                                            <Image SnapsToDevicePixels="True" LayoutTransform="{Binding Path=ImageLayoutTransform, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ImageControl}}}"
												Source="{Binding}" 
												Stretch="{Binding Path=Stretch, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ImageControl}}}" 
												StretchDirection="{Binding Path=StretchDirection, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:ImageControl}}}" />
                                        </DataTemplate>
                                    </dx:TransferControl.ContentTemplate>
                                </dx:TransferControl>
                                <!--END WPF-->
                                <!--ONLY SL
                                            <Image SnapsToDevicePixels="True" Source="{Binding Path=Source, RelativeSource={RelativeSource TemplatedParent}}" 
												Stretch="{Binding Path=Stretch, RelativeSource={RelativeSource TemplatedParent}}" />
                                ONLY SL-->
                            </Border>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>